## Package: knitr
## Version: 1.48
## Description: Provides a general-purpose tool for dynamic report
## generation in R using Literate Programming techniques.
##
## -- File: C:/Users/Huawei/AppData/Local/R/win-library/4.4/knitr/Meta/package.rds
## -- Fields read: Package, Version, Description
## Package: dplyr
## Version: 1.1.4
## Description: A fast, consistent tool for working with data frame like
## objects, both in memory and out of memory.
##
## -- File: C:/Users/Huawei/AppData/Local/R/win-library/4.4/dplyr/Meta/package.rds
## -- Fields read: Package, Version, Description
## Package: ggplot2
## Version: 3.5.1
## Description: A system for 'declaratively' creating graphics, based on
## "The Grammar of Graphics". You provide the data, tell 'ggplot2'
## how to map variables to aesthetics, what graphical primitives
## to use, and it takes care of the details.
##
## -- File: C:/Users/Huawei/AppData/Local/R/win-library/4.4/ggplot2/Meta/package.rds
## -- Fields read: Package, Version, Description
## Package: corrplot
## Version: 0.95
## Description: Provides a visual exploratory tool on correlation matrix
## that supports automatic variable reordering to help detect
## hidden patterns among variables.
##
## -- File: C:/Users/Huawei/AppData/Local/R/win-library/4.4/corrplot/Meta/package.rds
## -- Fields read: Package, Version, Description
## Package: plotly
## Version: 4.10.4
## Description: Create interactive web graphics from 'ggplot2' graphs
## and/or a custom interface to the (MIT-licensed) JavaScript
## library 'plotly.js' inspired by the grammar of graphics.
##
## -- File: C:/Users/Huawei/AppData/Local/R/win-library/4.4/plotly/Meta/package.rds
## -- Fields read: Package, Version, Description
Zbiór danych jest trochę za duży, żeby został przedstawiony zwłaszcza na wykresach czytelnie w całości, dlatego dalszą część analizy wykonano na próbce zbioru (od rozkładu wartości atrybutów).
Zbiór ma 4 zmienne nominalne, z których tak naprawdę tylko jedna niesie ze sobą przydatne informacje (Working.Ion), a pozostałe mają za dużo unikalnych wartości, żeby niosły ze sobą przydatne informacje w wizualizacji danych (Battery.Formula, Formula.Charge, Formula.Discharge).
W związku z tym powyższym, najczytelniej prezentuje się rozkład wartości głównego jonu. Najmniej zaś rozkłady wskaźników stabilności i maksymalnej różnicy między krokami napięcia przez sporą ilość wartości 0 w tych atrybutach.
Do ustalenia korelacji między zmiennymi potrzebne było wcześniejsze zakodowanie zmiennych znakowych na numeryczne przy pomocy Label Encoding.
Nagłówek pierwszych 5 kolumn zbioru danych:
## Battery.ID Battery.Formula Working.Ion Formula.Charge Formula.Discharge
## 1 mp-30_Al Al0-2Cu Al Cu Al2Cu
## 2 mp-1022721_Al Al1-3Cu Al AlCu Al3Cu
## 3 mp-8637_Al Al0-5Mo Al Mo Al5Mo
## 4 mp-129_Al Al0-12Mo Al Mo Al12Mo
## 5 mp-91_Al Al0-12W Al W Al12W
## 6 mp-1055908_Al Al0-12Mn Al Mn MnAl12
W zbiorze danych nie ma wartości NA lub NaN. Licznik brakujących wartości NA:
## [1] 0
Teoretycznie możnaby przyjąć wartości 0.0 za brakujące (stanowi większość wartości kolumn Atomic Fraction Charge i Max Voltage Step oraz pojedyncze wartości kolumn Stability Charge i Stability Discharge), ale jest to jednak jakaś wartość, więc załóżmy, że w zbiorze danych nie ma brakujących wartości.
Ilość wierszy i kolumn zbioru danych:
## [1] 4351 17
Podstawowe statystyki:
## Battery.ID Battery.Formula Working.Ion Formula.Charge
## Length:4351 Length:4351 Length:4351 Length:4351
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Formula.Discharge Max.Delta.Volume Average.Voltage Gravimetric.Capacity
## Length:4351 Min. : 0.00002 Min. :-7.755 Min. : 5.176
## Class :character 1st Qu.: 0.01747 1st Qu.: 2.226 1st Qu.: 88.108
## Mode :character Median : 0.04203 Median : 3.301 Median : 130.691
## Mean : 0.37531 Mean : 3.083 Mean : 158.291
## 3rd Qu.: 0.08595 3rd Qu.: 4.019 3rd Qu.: 187.600
## Max. :293.19322 Max. :54.569 Max. :2557.627
## Volumetric.Capacity Gravimetric.Energy Volumetric.Energy
## Min. : 24.08 Min. :-583.5 Min. :-2208.1
## 1st Qu.: 311.62 1st Qu.: 211.7 1st Qu.: 821.6
## Median : 507.03 Median : 401.8 Median : 1463.8
## Mean : 610.62 Mean : 444.1 Mean : 1664.0
## 3rd Qu.: 722.75 3rd Qu.: 614.4 3rd Qu.: 2252.3
## Max. :7619.19 Max. :5926.9 Max. :18305.9
## Atomic.Fraction.Charge Atomic.Fraction.Discharge Stability.Charge
## Min. :0.00000 Min. :0.007407 Min. :0.00000
## 1st Qu.:0.00000 1st Qu.:0.086957 1st Qu.:0.03301
## Median :0.00000 Median :0.142857 Median :0.07319
## Mean :0.03986 Mean :0.159077 Mean :0.14257
## 3rd Qu.:0.04762 3rd Qu.:0.200000 3rd Qu.:0.13160
## Max. :0.90909 Max. :0.993333 Max. :6.48710
## Stability.Discharge Steps Max.Voltage.Step
## Min. :0.00000 Min. :1.000 Min. : 0.0000
## 1st Qu.:0.01952 1st Qu.:1.000 1st Qu.: 0.0000
## Median :0.04878 Median :1.000 Median : 0.0000
## Mean :0.12207 Mean :1.167 Mean : 0.1503
## 3rd Qu.:0.09299 3rd Qu.:1.000 3rd Qu.: 0.0000
## Max. :6.27781 Max. :6.000 Max. :26.9607
Inicjacja ziarna i próbka 1000 elementów.
set.seed(13)
dsamp <- data[sample(nrow(data),1000),]
Ilość unikalnych wartości w kolumnach:
## Battery.ID 1000
## Battery.Formula 884
## Working.Ion 10
## Formula.Charge 683
## Formula.Discharge 871
## Max.Delta.Volume 999
## Average.Voltage 1000
## Gravimetric.Capacity 892
## Volumetric.Capacity 999
## Gravimetric.Energy 1000
## Volumetric.Energy 1000
## Atomic.Fraction.Charge 65
## Atomic.Fraction.Discharge 115
## Stability.Charge 843
## Stability.Discharge 909
## Steps 6
## Max.Voltage.Step 138
Histogramy pokazujące rozkład wartości dla atrybutów:
Wykresy przedstawiają zależności zmiennych, które ukazały znaczącą korelację (>=0.5), z wyróżnieniem głównego jonu odpowiadającego za transport ładunku w baterii.
Z większości wykresów przebijają się najlepsze średnie osiągi uzyskane przez baterie z ładunkiem litowym, co wyjaśniałoby dominację tego pierwiastka w rozkładzie atrybutu Working.Ion. W niektórych przypadkach jak, np. pojemność czy gęstość energii na tle innych wybijają się również glin i magnez. Pojemnością wyróżniają się także baterie z cynkiem.
Predykcja przeprowadzona przy pomocy regresji liniowej. Oś X to zmienna mogąca indukować jakiś trend, a na jej podstawie na osi Y jest zmienna zależna, którą próbujemy przewidzieć. Pod wykresem podsumowanie modelu.
Jeśli chodzi o ocenę parametrów modelu, to możemy zwrócić uwagę na trzy.
P-value w sekcji Coefficients. Mała wartość oznacza, że zmienna stanowi dobry dodatek do modelu. Im większa wartość (do 1), tym większa szansa procentowa, że zmienna nie ma większego znaczenia dla regresji. Standardowy próg określający przydatność zmiennej to 0.05.
Suma wartości w sekcji Residuals - im bliższa 0, tym lepsze dopasowanie linii do punktów na wykresie.
Współczynnik determinacji R2 określa jak duża część zmienności atrybutu zależnego może być wyjaśniona przez atrybut niezależy. Przyjmuje wartości od 0 do 1. Im bliżej 1, tym większa determinacja.
Dla zbadanych niżej kombinacji atrybutów wyróżniają się 3, chociaż żadna nie wykazuje wyjątkowo silnego związku między nimi. Warto zwrócić uwagę na predykcję Gravimetric.Energy przy pomocy Average.Voltage (R2 = 0.36), Volumetric Energy i Average.Voltage (R2 = 0.23) oraz Volumetric Energy i Volumetric Capacity (R2 = 0.1). Dla pozostałych kombinacji atrybutów wartość R2 nie zbliża się do 0.1.
Należy tu podkreślić, że regresja liniowa zakłada z góry liniową zależność między zmiennymi. Nieznalezienie takiej wcale nie musi oznaczać, że między zmiennymi nie istnieje zależność innego typu.
##
## Call:
## lm(formula = Gravimetric.Energy ~ Average.Voltage, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -668.37 -161.45 -37.49 102.46 2409.98
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 25.241 19.799 1.275 0.203
## Average.Voltage 138.891 5.825 23.843 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 269.6 on 998 degrees of freedom
## Multiple R-squared: 0.3629, Adjusted R-squared: 0.3623
## F-statistic: 568.5 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = Gravimetric.Energy ~ Max.Delta.Volume, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -925.83 -229.89 -54.56 159.02 2406.83
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 463.159 10.570 43.819 < 2e-16 ***
## Max.Delta.Volume -50.755 7.316 -6.938 7.15e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 329.9 on 998 degrees of freedom
## Multiple R-squared: 0.04601, Adjusted R-squared: 0.04506
## F-statistic: 48.13 on 1 and 998 DF, p-value: 7.151e-12
##
## Call:
## lm(formula = Gravimetric.Energy ~ Gravimetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1404.8 -206.9 -29.3 166.2 2016.5
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 367.54933 14.71113 24.984 < 2e-16 ***
## Gravimetric.Capacity 0.51468 0.06422 8.014 3.09e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 327.3 on 998 degrees of freedom
## Multiple R-squared: 0.06046, Adjusted R-squared: 0.05952
## F-statistic: 64.22 on 1 and 998 DF, p-value: 3.089e-15
##
## Call:
## lm(formula = Gravimetric.Energy ~ Volumetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1200.33 -209.06 -30.53 173.73 2057.77
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 377.9216 14.8994 25.36 < 2e-16 ***
## Volumetric.Capacity 0.1145 0.0166 6.90 9.21e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 329.9 on 998 degrees of freedom
## Multiple R-squared: 0.04554, Adjusted R-squared: 0.04458
## F-statistic: 47.61 on 1 and 998 DF, p-value: 9.211e-12
##
## Call:
## lm(formula = Volumetric.Energy ~ Average.Voltage, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2407.3 -723.8 -197.8 415.8 9752.3
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 399.31 83.36 4.79 1.92e-06 ***
## Average.Voltage 429.68 24.52 17.52 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1135 on 998 degrees of freedom
## Multiple R-squared: 0.2352, Adjusted R-squared: 0.2345
## F-statistic: 307 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = Volumetric.Energy ~ Max.Delta.Volume, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3086.5 -873.6 -199.6 596.2 9741.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1755.69 40.90 42.924 < 2e-16 ***
## Max.Delta.Volume -163.88 28.31 -5.789 9.49e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1276 on 998 degrees of freedom
## Multiple R-squared: 0.03249, Adjusted R-squared: 0.03152
## F-statistic: 33.51 on 1 and 998 DF, p-value: 9.492e-09
##
## Call:
## lm(formula = Volumetric.Energy ~ Gravimetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5699.8 -732.1 -134.7 588.2 8135.4
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1373.5643 56.2714 24.410 <2e-16 ***
## Gravimetric.Capacity 2.1129 0.2457 8.601 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1252 on 998 degrees of freedom
## Multiple R-squared: 0.06901, Adjusted R-squared: 0.06808
## F-statistic: 73.97 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = Volumetric.Energy ~ Volumetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6018.4 -691.9 -117.3 600.8 7694.3
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.289e+03 5.544e+01 23.26 <2e-16 ***
## Volumetric.Capacity 6.681e-01 6.178e-02 10.81 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1228 on 998 degrees of freedom
## Multiple R-squared: 0.1049, Adjusted R-squared: 0.104
## F-statistic: 117 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = Stability.Charge ~ Average.Voltage, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.1672 -0.1138 -0.0741 -0.0121 3.4172
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.131030 0.024392 5.372 9.7e-08 ***
## Average.Voltage 0.006127 0.007177 0.854 0.393
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3321 on 998 degrees of freedom
## Multiple R-squared: 0.0007299, Adjusted R-squared: -0.0002714
## F-statistic: 0.7289 on 1 and 998 DF, p-value: 0.3934
##
## Call:
## lm(formula = Stability.Charge ~ Max.Delta.Volume, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.4910 -0.1083 -0.0707 -0.0094 3.4124
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.144990 0.010603 13.674 < 2e-16 ***
## Max.Delta.Volume 0.020731 0.007339 2.825 0.00482 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3309 on 998 degrees of freedom
## Multiple R-squared: 0.007932, Adjusted R-squared: 0.006938
## F-statistic: 7.98 on 1 and 998 DF, p-value: 0.004825
##
## Call:
## lm(formula = Stability.Charge ~ Gravimetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.6389 -0.1056 -0.0664 -0.0141 3.4193
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.069e-01 1.481e-02 7.218 1.04e-12 ***
## Gravimetric.Capacity 2.639e-04 6.464e-05 4.082 4.82e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3295 on 998 degrees of freedom
## Multiple R-squared: 0.01642, Adjusted R-squared: 0.01544
## F-statistic: 16.66 on 1 and 998 DF, p-value: 4.819e-05
##
## Call:
## lm(formula = Stability.Charge ~ Volumetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.7566 -0.0976 -0.0601 -0.0184 3.4329
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.011e-02 1.477e-02 6.102 1.50e-09 ***
## Volumetric.Capacity 9.321e-05 1.645e-05 5.665 1.92e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.327 on 998 degrees of freedom
## Multiple R-squared: 0.03116, Adjusted R-squared: 0.03018
## F-statistic: 32.09 on 1 and 998 DF, p-value: 1.922e-08
##
## Call:
## lm(formula = Stability.Discharge ~ Average.Voltage, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.2299 -0.0955 -0.0645 -0.0262 3.3050
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.230349 0.023151 9.950 < 2e-16 ***
## Average.Voltage -0.032960 0.006812 -4.839 1.51e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3152 on 998 degrees of freedom
## Multiple R-squared: 0.02292, Adjusted R-squared: 0.02194
## F-statistic: 23.41 on 1 and 998 DF, p-value: 1.512e-06
##
## Call:
## lm(formula = Stability.Discharge ~ Max.Delta.Volume, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.7744 -0.1045 -0.0745 -0.0260 3.3623
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.121108 0.010093 11.999 < 2e-16 ***
## Max.Delta.Volume 0.034842 0.006986 4.988 7.21e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.315 on 998 degrees of freedom
## Multiple R-squared: 0.02432, Adjusted R-squared: 0.02334
## F-statistic: 24.88 on 1 and 998 DF, p-value: 7.205e-07
##
## Call:
## lm(formula = Stability.Discharge ~ Gravimetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.2729 -0.1099 -0.0793 -0.0290 3.3580
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.170e-01 1.432e-02 8.170 9.28e-16 ***
## Gravimetric.Capacity 7.523e-05 6.252e-05 1.203 0.229
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3186 on 998 degrees of freedom
## Multiple R-squared: 0.001449, Adjusted R-squared: 0.0004484
## F-statistic: 1.448 on 1 and 998 DF, p-value: 0.2291
##
## Call:
## lm(formula = Stability.Discharge ~ Volumetric.Capacity, data = dsamp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.2636 -0.1089 -0.0770 -0.0281 3.3620
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.117e-01 1.438e-02 7.771 1.93e-14 ***
## Volumetric.Capacity 2.730e-05 1.602e-05 1.704 0.0886 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3184 on 998 degrees of freedom
## Multiple R-squared: 0.002902, Adjusted R-squared: 0.001903
## F-statistic: 2.905 on 1 and 998 DF, p-value: 0.08863